home *** CD-ROM | disk | FTP | other *** search
/ Point Programming 1 / PPROG1.ISO / pascal / swag / screen.swg / 0080_Character at Row.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-02-28  |  1.3 KB  |  37 lines

  1. {
  2. Someone has suggested that you use the BIOS routines, but I don't
  3. think his code was complete.  In case you want to go the BIOS
  4. route, I hacked out a routine that does that:
  5. }
  6.  
  7. function Screen(row, column : byte): char; assembler;
  8. { returns the char at Row, Column }
  9. asm
  10.   MOV  AH, 0FH
  11.   INT  10H       { Get active display page in BH, where it stays for
  12.                    remainder of this routine }
  13.  
  14.   MOV  AH, 03H
  15.   INT  10H       { Get current cursor settings for active display page }
  16.  
  17.   PUSH DX        { Save cursor coordinants on stack }
  18.  
  19.   MOV  DH, row
  20.   MOV  DL, column
  21.   DEC  DH        { Make allowance for the fact that BIOS treats origin }
  22.   DEC  DL        { as 0,0, whereas we want it treated as 1,1           }
  23.   MOV  AH, 02H
  24.   INT  10H       { Move cursor to row-1, column-1 }
  25.  
  26.   MOV  AH, 08H
  27.   INT  10H       { Get character at cursor in AL, where it stays until
  28.                    returned by function }
  29.  
  30.   POP  DX        { Restore old cursor coordinates to DX }
  31.   MOV  AH, 02H
  32.   INT  10H       { Move cursor back where it was }
  33. end;
  34. ---
  35.  * Blue Lake System OR 503-656-9790 v.32bis 5 Node 12 Gig 
  36.  * PostLink(tm) v1.20  BLUELAKE (#433) : RelayNet(tm)
  37.